package com.blovesoft.tokenup.ui.mine;

import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.content.ContextCompat;
import android.text.TextPaint;
import android.text.method.LinkMovementMethod;
import android.text.style.ClickableSpan;
import android.view.View;
import android.widget.TextView;

import com.blankj.utilcode.util.KeyboardUtils;
import com.blankj.utilcode.util.SpanUtils;
import com.blankj.utilcode.util.StringUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.blovesoft.tokenup.R;
import com.blovesoft.tokenup.util.SubUtils;
import com.llkj.common.base.BaseActivity;
import com.llkj.common.di.component.AppComponent;

import java.security.Key;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * author: zhu.px
 * e-mail: 1271901673@qq.com
 * time  : 2018/5/28
 * desc  : 关注公众号
 */
public class ContactUsActivity extends BaseActivity {

    @BindView(R.id.tv_group)
    TextView tvGroup;

    @Override
    public int getLayoutResId() {
        return R.layout.activity_contact_us;
    }

    @Override
    public boolean useEventBus() {
        return false;
    }

    @Override
    public void initView() {
        tvGroup.setMovementMethod(LinkMovementMethod.getInstance());
        tvGroup.setHighlightColor(ContextCompat.getColor(mContext, R.color.transparent));
        tvGroup.setText(new SpanUtils().append("电报群：").setFontSize(15, true)
                .append("http://www.baidu.com")
                .setClickSpan(new ClickableSpan() {
                    @Override
                    public void onClick(View widget) {
                        ToastUtils.showShort("click");
                    }

                    @Override
                    public void updateDrawState(TextPaint ds) {
                        ds.setColor(ContextCompat.getColor(mContext, R.color.color_2871db));
                        ds.setUnderlineText(true);
                    }
                })
                .create());
    }

    @Override
    public void initData() {

    }

    @Override
    public void getBundleExtras(Bundle extras) {

    }

    @Override
    public void initListener() {

    }

    @Override
    public void setupActivityComponent(@NonNull AppComponent appComponent) {

    }

    @OnClick(R.id.tv_copy)
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.tv_copy:
                SubUtils.copyText("");
                ToastUtils.showShort("文本已复制到剪切板");
                break;
            default:
                break;
        }
    }

}
